﻿[
{
    "name": "Credentials",
    "desc": "Provides a common way to securely store and manage your passcodes, passphrases, and other identification information.",
    "source": function () {
        var passwordVault = new Windows.Security.Credentials.PasswordVault();
        for (var i = 0; i < 10; i++) {
            var passwordCredential = new Windows.Security.Credentials.PasswordCredential("resource" + i, "username" + i % 3, "password" + i);
            passwordVault.add(passwordCredential);
        }
        var list = passwordVault.findAllByUserName("username1");
        for (var i = 0; i < list.size; i++) {
            var before = list[i].password;
            list[i].retrievePassword();
            var after = list[i].password;
            console.log("Resource: ", list[i].resource, {
                "UserName": list[i].userName,
                "Before retriving password": before,
                "After retriving password": after,
            });
        }

    }
}
]